if (!jsx3.lang.Class.forName("ux.cdb.admin.mechanism.schema.Schema")) {

/**
 * Define the <code>name of class</code> class.
 * This class inherit from <code>jsx3.gui.Block<code> GUI class.
 */
jsx3.Class.defineClass(
		"ux.cdb.admin.mechanism.schema.Schema",
		jsx3.gui.Block,
		null,
		function (objRoot) {
			objRoot.prototype.btnAdd=null;
			objRoot.prototype.btnEdit=null;
			objRoot.prototype.btnDelete=null;
			objRoot.prototype.matrix=null;
			objRoot.prototype.isEdit=null;
			objRoot.prototype.currPage=1;
			objRoot.prototype.pageSize=15;
			objRoot.prototype.totalPage=0;
			objRoot.prototype.totalCount=0;
			objRoot.prototype.lastType=null;//save last time which type user selected , if type not changed,do not load panel agaim
			objRoot.prototype.loadCount=0;//times counter use for judge whether all the detail panel loaded
			/**
			 * This method will be called after UI file has deserialized.
			 */
			objRoot.prototype.onAfterDeserialize = function() {
					
					
			}
			
			objRoot.prototype.initialize=function()
			{
				var me=this;
				//ux.cdb.admin.CommonCache.loadCache([],this,function(){});
				this.pageBar=this.getDescendantOfName("blkPageWheel");
				this.pageBar.initialize();
				//this.pageBar.setValue(0,0,this.pageSize,this.totalCount);
				this.btnAdd=this.getDescendantOfName("btn_schema_add");
				this.btnEdit=this.getDescendantOfName("btn_schema_edit");
				this.btnDelete=this.getDescendantOfName("btn_schema_delete");
				this.matrix=this.getDescendantOfName("mtx_schema_main");
				this.btnEdit.setEnabled(jsx3.gui.Form.STATEDISABLED,true);
				this.btnDelete.setEnabled(jsx3.gui.Form.STATEDISABLED,true);
				this.matrix.subscribe(ux.cdb.admin.gui.Matrix.EVENT_CHECKALL, me, me.ruleChecked);
				 var  privil = ux.cdb.admin.Privilege.getPrivilege(7);
				 if (privil==null)
				 {//user can not add
				 	this.btnAdd.setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
				 }
				 privil = ux.cdb.admin.Privilege.getPrivilege(8);
				 if (privil==null)
				 {//user can not edit
				 	this.btnEdit.setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
				 }
				//get the common cache for search
				ux.cdb.admin.CommonCache.loadCache(["COOPER_AGREEMENT_TYPE",'COOPER_AGREEMENT_LEVEL_CODE'], me,me.cacheLoaded);
			}
			
			
			/**
			 * call back function when cahce loaded
			 */
			objRoot.prototype.cacheLoaded=function()
			{
				var cache = ux.cdb.admin.CommonCache.getInstance();
				var typeList=cache.getCache('CommonCache_COOPER_AGREEMENT_TYPE');
				var nodes=typeList.getChildNodes();
				var i;
				
				for(i=0;i<nodes.size();i++)
				{
					
					if (nodes.get(i).getAttribute("jsxid")!="004")
					{
						nodes.get(i).setAttribute("jsxstyle","color:#C0C0C0");
					}
				}
				
				this.getDescendantOfName("blkSearchType").getDescendantOfName("selValue").setSourceXML(typeList);
				//this.callGetCooperAgreementUCC();
			}
			
			
			objRoot.prototype.ruleSelected=function()
			{//user selected some record
				var detailPanel=this.getDescendantOfName("blkShowDetail");
				var notice=this.getDescendantOfName("blk_schema_notice");
				var orgType = this.matrix.getSelectedNodes().get(0).getAttribute("jsxType");
				if (orgType==this.lastType)
				{//type equale, do not load panel again ,load data directly
					
					if (orgType == "004") {
						this.loadCount=3;
						this.assistTypeLoaded();
						return;
					}
					
					return;	
				}
				
				//init the tab by organization's type
				if (orgType == "004") {
					this.showPaneTypeAssist();
					//display the tab
					detailPanel.setDisplay(jsx3.gui.Block.DISPLAYBLOCK, true);
					notice.setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
				}
				else{
					detailPanel.setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
					notice.setDisplay(jsx3.gui.Block.DISPLAYBLOCK, true);
				}
				this.lastType=orgType;
			}
	
					
			objRoot.prototype.ruleChecked=function(mtx)
			{//user checked some record

				if (this.matrix.getCheckedNodes().size()>0)
				{
					this.btnDelete.setEnabled(jsx3.gui.Form.STATEENABLED, true);
					if (this.matrix.getCheckedNodes().size() == 1) {
						this.btnEdit.setEnabled(jsx3.gui.Form.STATEENABLED, true);
					}
					else{
						this.btnEdit.setEnabled(jsx3.gui.Form.STATEDISABLED, true);
					}
				}
				else
				{
					this.btnDelete.setEnabled(jsx3.gui.Form.STATEDISABLED, true);
					this.btnEdit.setEnabled(jsx3.gui.Form.STATEDISABLED, true);
				}
			}
			//invest type
			objRoot.prototype.showPaneTypeInvest=function()
			{
				var me=this;
				var tabname=[
							{name:"schemaDetailTab1",text:"@cdb@Mechanism@Schema@BaseinfoTitle",url:"ux/cdb/admin/mechanism/schema/invest/ui/SchemaInvestBaseinfo.xml"},
							{name:"schemaDetailTab2",text:"@cdb@Mechanism@Schema@PrincipleTitle",url:"ux/cdb/admin/mechanism/schema/invest/ui/SchemaInvestPrinciple.xml"},
							{name:"schemaDetailTab3",text:"@cdb@Mechanism@Schema@CooperateTitle",url:"ux/cdb/admin/mechanism/schema/invest/ui/SchemaInvestCooperation.xml"},
							{name:"schemaDetailTab4",text:"@cdb@Mechanism@Schema@ReserveTitle",url:"ux/cdb/admin/mechanism/schema/invest/ui/SchemaInvestReserve.xml"},
							{name:"schemaDetailTab5",text:"@cdb@Mechanism@Schema@AssureTitle",url:"ux/cdb/admin/mechanism/schema/invest/ui/SchemaInvestCooOrgAssure.xml"},
							{name:"schemaDetailTab6",text:"@cdb@Mechanism@Schema@CompensateTitle",url:"ux/cdb/admin/mechanism/schema/invest/ui/SchemaInvestCompensate.xml"},
							{name:"schemaDetailTab7",text:"@cdb@Mechanism@Schema@Invest@Attachment",url:"ux/cdb/admin/mechanism/schema/invest/ui/ShemaInvestAttachment.xml"}
							];
				this.showTabs(tabname,null);
				
						
			}
			//assist type
			objRoot.prototype.showPaneTypeAssist=function()
			{
				var me=this;
				var tabname=[
							{name:"schemaDetailTab1",text:"@cdb@Mechanism@Schema@BaseinfoTitle",url:"ux/cdb/admin/mechanism/schema/loanassist/ui/SchemaLoanAssistBaseinfo.xml"},
							{name:"schemaDetailTab2",text:"@cdb@Mechanism@Assist@InterestTitle",url:"ux/cdb/admin/mechanism/schema/loanassist/ui/SchemaLoanAssistInterest.xml"},
							{name:"schemaDetailTab3",text:"@cdb@Mechanism@Assist@ReserveRatioTitle",url:"ux/cdb/admin/mechanism/schema/loanassist/ui/SchemaLoanAssistCompensate.xml"},
							{name:"schemaDetailTab4",text:"",url:"none"},
							{name:"schemaDetailTab5",text:"",url:"none"},
							{name:"schemaDetailTab6",text:"",url:"none"},
							{name:"schemaDetailTab7",text:"",url:"none"}
							];
				//this.showTabs(tabname,this.assistTypeLoaded);
				this.showTabs(tabname,me.assistTypeLoaded);
						
			}
			
			//assist type loaded
			objRoot.prototype.assistTypeLoaded=function()
			{//when assist detail panel loaded,call the service operation to get detail data
				this.loadCount+=1;
				if (this.loadCount = 4) {
					this.loadCount=0;
					//all panel loaded
					var me = this;
					var record = this.matrix.getSelectedNodes().get(0);
					var assistDetail = this.getDescendantOfName("schemaDetailTab1").getContentPane().getDescendantOfName("blkAssistDetailBaseinfo");
					
					assistDetail.setDataEntityType(ux.cdb.admin.dataautomate.GenericDetail.CooperAgreement);
					assistDetail.setDataEntityId(record.getAttribute("jsxOrgid") + ";" + record.getAttribute("jsxcode"));//id=shcemaid;CooOrgID
					assistDetail.setProcessHandler(function(obj){
						return me.showAssistMatrix(obj);
					});
					assistDetail.refreshData();

				}
				
				return;
			}
			
			/**
			 * receive the detail data from server,assemble the data from matrix
			 */
			objRoot.prototype.showAssistMatrix=function(data)
			{
				var server=ux.megatron.Main.getServer();
				var cacheIntr=new jsx3.xml.CDF.Document.newDocument();
				var cacheCmp=new jsx3.xml.CDF.Document.newDocument();
				var intrMatrix=this.getDescendantOfName("schemaDetailTab2").getContentPane().getDescendantOfName("mtx_Schema_Interest");
				var cmpMatrix=this.getDescendantOfName("schemaDetailTab3").getContentPane().getDescendantOfName("mtx_Schema_Compensate");
				//generator the cdf for the loan assist interest ratio
				cacheIntr.insertRecord({
						jsxid:0,											
						jsxtype:server.getDynamicProperty("@cdb@Mechanism@Assist@InterestMatrixType0"),
						jsxcenter:data.centralFinanceSubsidyPct1,					
						jsxprovince:data.provinceFinanceSubsidyPct1,
						jsxcity:data.cityFinanceSubsidyPctSubsidy1,
						jsxcounty:data.countyFinanceSubsidyPct1,
						jsxothers:data.otherPartSubsidyPct1		
										});
				cacheIntr.insertRecord({
						jsxid:1,											
						jsxtype:server.getDynamicProperty("@cdb@Mechanism@Assist@InterestMatrixType1"),
						jsxcenter:data.centralFinanceSubsidyPct2,					
						jsxprovince:data.provinceFinanceSubsidyPct2,
						jsxcity:data.cityFinanceSubsidyPctSubsidy2,
						jsxcounty:data.countyFinanceSubsidyPct2,
						jsxothers:data.otherPartSubsidyPct2		
										});
				cacheIntr.insertRecord({
						jsxid:2,											
						jsxtype:server.getDynamicProperty("@cdb@Mechanism@Assist@InterestMatrixType2"),
						jsxcenter:data.centralFinanceSubsidyPct3,					
						jsxprovince:data.provinceFinanceSubsidyPct3,
						jsxcity:data.cityFinanceSubsidyPctSubsidy3,
						jsxcounty:data.countyFinanceSubsidyPct3,
						jsxothers:data.otherPartSubsidyPct3		
										});


				//put the data into the cache
				ux.megatron.Main.getServer().getCache().setDocument("cchSchemaLoadAssistInterestShowDetail",cacheIntr);
				intrMatrix.repaintData();
				if (data.otherSharePartyNameSubsidy1 == null) 
				{
					data.otherSharePartyNameSubsidy1 = "";
				}
				intrMatrix.getDescendantOfName("titleothers").setText(ux.megatron.Main.getServer().getDynamicProperty("@cdb@Mechanism@Assist@InterestMatrixTitle5")+"<br>"+data.otherSharePartyNameSubsidy1,true);
				//generator the cache for loan assist compensate
				cacheCmp.insertRecord({
						jsxid:0,											
						jsxtype:server.getDynamicProperty("@cdb@Mechanism@Assist@InterestMatrixType0"),
						jsxcenter:data.centralFinanceSharedPct1,					
						jsxprovince:data.provinceFinanceSharePct1,
						jsxcity:data.cityFinanceSubsidyPct1,
						jsxcounty:data.countyFinanceSharePct1,
						jsxothers:data.otherPartSharePct1		
										});
				cacheCmp.insertRecord({
						jsxid:1,											
						jsxtype:server.getDynamicProperty("@cdb@Mechanism@Assist@InterestMatrixType1"),
						jsxcenter:data.centralFinanceSharedPct2,					
						jsxprovince:data.provinceFinanceSharePct2,
						jsxcity:data.cityFinanceSubsidyPct2,
						jsxcounty:data.countyFinanceSharePct2,
						jsxothers:data.otherPartSharePct2		
										});
				cacheCmp.insertRecord({
						jsxid:2,											
						jsxtype:server.getDynamicProperty("@cdb@Mechanism@Assist@InterestMatrixType2"),
						jsxcenter:data.centralFinanceSharedPct3,					
						jsxprovince:data.provinceFinanceSharePct3,
						jsxcity:data.cityFinanceSubsidyPct3,
						jsxcounty:data.countyFinanceSharePct3,
						jsxothers:data.otherPartSharePct3		
										});

				//put the data into the cache
				ux.megatron.Main.getServer().getCache().setDocument("cchSchemaLoadAssistCmpShowDetail",cacheCmp);
				cmpMatrix.repaintData();
				if (data.otherSharePartyName1 == null) 
				{
					data.otherSharePartyName1 = "";
				}
				cmpMatrix.getDescendantOfName("titleothers").setText(ux.megatron.Main.getServer().getDynamicProperty("@cdb@Mechanism@Assist@InterestMatrixTitle5")+"<br>"+data.otherSharePartyName1,true);
				this.getDescendantOfName("schemaDetailTab3").getContentPane().getDescendantOfName("blkCmpRatio").getDescendantOfName("lblValue").setText(data.riskSharePct,true);
				this.getDescendantOfName("schemaDetailTab3").getContentPane().getDescendantOfName("blkOverflowRisk").setDataByObject({cdbChargeLossPct:data.cdbChargeLossPct,cooperOrgChargeLossPct:data.cooperOrgChargeLossPct});
				
				
				return data;
			}
	
			//assure type
			objRoot.prototype.showPaneTypeAssure=function()
			{
				var me=this;
				var tabname=[
							{name:"schemaDetailTab1",text:"@cdb@Mechanism@Schema@BaseinfoTitle",url:"ux/cdb/admin/mechanism/schema/assure/ui/SchemaAssureBaseinfo.xml"},
							{name:"schemaDetailTab2",text:"@cdb@Mechanism@Schema@Assure@AgentLoanTitle",url:"ux/cdb/admin/mechanism/schema/assure/ui/SchemaAssureAgentLoan.xml"},
							{name:"schemaDetailTab3",text:"@cdb@Mechanism@Schema@CompensateTitle",url:"ux/cdb/admin/mechanism/schema/assure/ui/SchemaAssureCompensate.xml"},
							{name:"schemaDetailTab4",text:"@cdb@Mechanism@Schema@Invest@Attachment",url:"ux/cdb/admin/mechanism/schema/invest/ui/ShemaInvestAttachment.xml"},
							{name:"schemaDetailTab5",text:"",url:"none"},
							{name:"schemaDetailTab6",text:"",url:"none"},
							{name:"schemaDetailTab7",text:"",url:"none"}
							];
				this.showTabs(tabname,null);
				
						
			}
			//credit type
			objRoot.prototype.showPaneTypeMiniCredit=function()
			{
				var me=this;
				var tabname=[
							{name:"schemaDetailTab1",text:"@cdb@Mechanism@Schema@BaseinfoTitle",url:"ux/cdb/admin/mechanism/schema/invest/ui/SchemaInvestBaseinfo.xml"},
							{name:"schemaDetailTab2",text:"@cdb@Mechanism@Schema@CooperateInfoTitle",url:"ux/cdb/admin/mechanism/schema/minicredit/ui/SchemaMiniCreditCooperationInfo.xml"},
							{name:"schemaDetailTab3",text:"@cdb@Mechanism@Schema@Assure@AgentLoanTitle",url:"ux/cdb/admin/mechanism/schema/minicredit/ui/SchemaMiniCreditAgentLoan.xml"},
							{name:"schemaDetailTab4",text:"@cdb@Mechanism@Schema@AgentAndQueryFee",url:"ux/cdb/admin/mechanism/schema/minicredit/ui/SchemaMiniCreditAgentfee.xml"},
							{name:"schemaDetailTab5",text:"@cdb@Mechanism@Schema@CompensateTitle",url:"ux/cdb/admin/mechanism/schema/minicredit/ui/SchemaMiniCreditCompensate.xml"},
							{name:"schemaDetailTab6",text:"@cdb@Mechanism@Schema@Invest@Attachment",url:"ux/cdb/admin/mechanism/schema/invest/ui/ShemaInvestAttachment.xml"},
							{name:"schemaDetailTab7",text:"",url:"none"}
							];
				this.showTabs(tabname,null);
				
						
			}

			objRoot.prototype.showTabs = function(tabs,callbackfunc)
			{
				var server=ux.megatron.Main.getServer();
				var me=this;
				for(var i=0;i<tabs.length;i++)
				{	
					var tabBaseinfo=this.getDescendantOfName(tabs[i].name);
					tabBaseinfo.getContentPane().removeChildren();
					if (tabs[i].url != "none") {
						ux.megatron.Main.loadUIResourceAsync(tabBaseinfo.getContentPane(), "ux.cdb.admin", tabs[i].url, me, callbackfunc);
						tabBaseinfo.setText(server.getDynamicProperty(tabs[i].text));
						tabBaseinfo.repaint();
						tabBaseinfo.setDisplay(jsx3.gui.Block.DISPLAYBLOCK,true);
						
					}
					else
					{
						tabBaseinfo.setDisplay(jsx3.gui.Block.DISPLAYNONE,true);
					}
				}
				this.getDescendantOfName("blkShowDetail").repaint();			
			}
			 //when user click delete
	        objRoot.prototype.onDelete = function(){
				var server=ux.megatron.Main.getServer();
	            ux.megatron.Dialog.confirm(server.getDynamicProperty("@cdb@Mechanism@Schema@Alert"), server.getDynamicProperty("@cdb@Mechanism@Schema@AlertTitle"), this.callDeleteRecord, null);
	            
	        }
			//when user click add button
			objRoot.prototype.onAdd=function()
			{
				//load the dialog
				var parent = ux.megatron.Main.getServer().getBodyBlock();
				this.isEdit=false;
				var me=this;
	            ux.megatron.Main.loadUIResourceAsync(parent, "ux.cdb.admin", "ux/cdb/admin/mechanism/schema/ui/SchemaWizard.xml", me, me.onBuilderLoaded);
			}
			 //when user click edit button
	        objRoot.prototype.onEdit = function(){
	            //load the dialog
				var parent = ux.megatron.Main.getServer().getBodyBlock();
				this.isEdit=true;
				var me=this;
				var orgType = this.matrix.getCheckedNodes().get(0).getAttribute("jsxType");
				if (orgType == "004") {
					ux.megatron.Main.loadUIResourceAsync(parent, "ux.cdb.admin", "ux/cdb/admin/mechanism/schema/ui/SchemaWizard.xml", me, me.onBuilderLoaded);
				}
			}
			
			//call service interface GetCooperAgreementUCC to get the list -get all
			objRoot.prototype.callGetCooperAgreementUCC=function()
			{	
				ux.megatron.util.Dwr.callDwr("GetCooperAgreementUCC", "getCooperAgreementListByCondition", [null,null,null,null,1,this.pageSize], this, this.loadSchemaList);
			}
			/**
			 * when user click search do this function
			 */
			objRoot.prototype.onSearch=function()
			{	
				this.lastType=null;
				this.currPage=1;
				var detailPanel=this.getDescendantOfName("blkShowDetail");
				var notice=this.getDescendantOfName("blk_schema_notice");
				//show the notice panel hiiden the detail panel
	            detailPanel.setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
	            notice.setDisplay(jsx3.gui.Block.DISPLAYBLOCK, true);
				var code=this.getDescendantOfName("blkSearchCode").getDescendantOfName("txtValue").getValue();
				var name=this.getDescendantOfName("blkSearchName").getDescendantOfName("txtValue").getValue();
				var type=this.getDescendantOfName("blkSearchType").getDescendantOfName("selValue").getValue();
				if (code=="")
				{
					code=null;
				}
				if (name=="")
				{
					name=null;
				}
				if (type=="")
				{
					type=null;
				}
				//GetCooperAgreementUCC.getCooperAgreementListByCondition( internalOrgId 内部机构编号-分行, cooperAgreementTypeCode 合作协议类型, cooperAgreementNbr 合作协议编号, partybName 合作机构名称, String curPage, String pageSize)
				ux.megatron.util.Dwr.callDwr("GetCooperAgreementUCC", "getCooperAgreementListByCondition", [null,type,code,name,1,this.pageSize], this, this.loadSchemaList);
			}
			//load data
			objRoot.prototype.loadSchemaList=function(objEvent)
			{
				
				//clear the type
				this.lastType=null;
				
				//got the data  assemble the cache 
				var cache=jsx3.xml.CDF.Document.newDocument();
				var record;
				var recordinfo;
			    //alert(ux.megatron.util.JSON.JSONtoString(objEvent));
				this.totalCount=objEvent.content.page.count;//take the pageinfo
				recordinfo=objEvent.content.data;//take the records
				
				this.totalPage=Math.ceil(this.totalCount/this.pageSize);
				
				this.getDescendantOfName("lblTotPageNo").setText("/"+this.totalPage,true);//show total page
				this.getDescendantOfName("txtPageNoInput").setValue(this.currPage);//show currpage
				if (recordinfo != null) {
				
					if (recordinfo.length) {
						//multi-record
						for (var i = 0; i < recordinfo.length; i++) {
							record = {
								jsxid: i,
								jsxOrgid:recordinfo[i].partyId,//合作机构代码
								jsxcode: recordinfo[i].cooperAgreementNbr, //合作协议代码
								jsxname: recordinfo[i].partybName, //合作机构名称
								jsxBranch: recordinfo[i].internalOrgId, //分行代码
								jsxType: recordinfo[i].cooperAgreementTypeCode, //合作协议类型代码
								jsxBranchName:recordinfo[i].internalOrgName,//分行名称
								jsxTypeName:recordinfo[i].cooperOrgTypeName//合作协议类型名称
							};
							
							cache.insertRecord(record);
						}
					}
					else {
						/*
						//single record
						cache.insertRecord({
							jsxid: 0,
							jsxcode: recordinfo.cooperAgreementNbr, //合作协议代码
							jsxname: recordinfo.partybName, //合作机构名称
							jsxBranch: recordinfo.internalOrgId, //分行名称
							jsxType: recordinfo.cooperAgreementTypeCode //合作协议类型
						});*/
					}
				}
	            ux.megatron.Main.getServer().getCache().setDocument("cchSchemaList",cache);
				this.pageBar.setValue(this.currPage,this.totalPage,this.pageSize,this.totalCount);
				this.matrix.repaint();
			}
			 
			objRoot.prototype.onRefresh = function(isEdit){
				
				if (isEdit) 
				{
					//remove the cache
					var record = this.matrix.getCheckedNodes().get(0);
					var editid = record.getAttribute("jsxOrgid") + ";" + record.getAttribute("jsxcode");
					ux.cdb.admin.Cache.remove(ux.cdb.admin.dataautomate.GenericDetail.CooperAgreement + ":" + editid);
					console.log("\r\r\tcache cleared【" + ux.cdb.admin.dataautomate.GenericDetail.CooperAgreement + ":" + editid + "】\t");
				}
				//refresh
				this.currPage=1;
	            this.onSearch();
	            
	        }
			//wizard loaded
			objRoot.prototype.onBuilderLoaded=function(objEvent)
			{
	
				var wizard=null
				var parent = ux.megatron.Main.getServer().getBodyBlock();
	
				wizard=parent.getDescendantsOfType("ux.cdb.admin.mechanism.schema.SchemaWizard");
	
				wizard[0].isEdit=this.isEdit;
				if (this.isEdit) {
					wizard[0].schemaType = this.matrix.getCheckedNodes().get(0).getAttribute("jsxType");
					wizard[0].schemaId = this.matrix.getCheckedNodes().get(0).getAttribute("jsxcode");
					wizard[0].orgId = this.matrix.getCheckedNodes().get(0).getAttribute("jsxOrgid");
					console.log("\r\r\t"+this.matrix.getCheckedNodes().get(0)+"\r");
				}
				wizard[0].loadContent();
			}
			objRoot.prototype.changePage = function(direct){
				//calculate the next page
				this.currPage=this.currPage+direct;
				if (this.currPage < 1) {
					//if pagenum <0 it will be 1 and not move
					this.currPage = 1
					return;
				}
				if (this.currPage>this.totalPage)
				{//if pagenum>totalpage it wiil be total page and not move
					this.currPage=this.totalPage;
					return;
				}
				//require data
				var code=this.getDescendantOfName("blkSearchCode").getDescendantOfName("txtValue").getValue();
				var name=this.getDescendantOfName("blkSearchName").getDescendantOfName("txtValue").getValue();
				var type=this.getDescendantOfName("blkSearchType").getDescendantOfName("selValue").getValue();
				if (code=="")
				{
					code=null;
				}
				if (name=="")
				{
					name=null;
				}
				if (type=="")
				{
					type=null;
				}
				//GetCooperAgreementUCC.getCooperAgreementListByCondition( internalOrgId 内部机构编号-分行, cooperAgreementTypeCode 合作协议类型, cooperAgreementNbr 合作协议编号, partybName 合作机构名称, String curPage, String pageSize)
				ux.megatron.util.Dwr.callDwr("GetCooperAgreementUCC", "getCooperAgreementListByCondition", [null,type,code,name,this.currPage,this.pageSize], this, this.loadSchemaList);
			}
			/**
			 * user select schema type on search bar
			 * @param {Object} select
			 */
			objRoot.prototype.typeSelected = function(select){

			//hold back user select other type
			if (select.getValue()!="004")
			{
				select.setValue(null);
			}
		}
        
		});
}